import React from 'react';
import logo from './logo.svg';
import './App.css';
import {BrowserRouter as Router, Route, Routes} from 'react-router-dom';
import HomePage from './pages/Home';
import BasicLayout from './layouts/BasicLayout';
import TextUploadPage from './pages/Text/Upload';
import TextListPage from './pages/Text/List';
import TaskListPage from './pages/Task/List';
import AlgorithmConfigPage from './pages/Algorithm/Config';
import AlgorithmListPage from "./pages/Algorithm/List";
import AlgorithmEditPage from './pages/Algorithm/Edit';
import SimilarityPage from "./pages/Text/Similarity";
import Cosine from "./pages/Algorithm/Cosine";
import CosineIntroduction from "./pages/Algorithm/Cosine";
import JaccardIntroduction from "./pages/Algorithm/Jaccard";
import TFIDFIntroduction from "./pages/Algorithm/Tf-Idf";
import LevenshteinIntroduction from "./pages/Algorithm/Levenshtein";
import BertIntroduction from "./pages/Algorithm/Bert";
import SimilarityAnalysisHistory from "./pages/Text/History";
import Login from "./pages/Login";

function App() {
    return (
        <Router>
            <Routes>
                <Route path="/login" element={<Login/>}/>
                <Route path="/" element={<HomePage/>}/>
                <Route element={<BasicLayout/>}>
                    <Route path="/text">
                        <Route path="upload" element={<TextUploadPage/>}/>
                        <Route path="list" element={<TextListPage/>}/>
                    </Route>
                    {/* 任务管理路由 */}
                    <Route path="/tasks">
                        <Route path="list" element={<TaskListPage/>}/>
                    </Route>

                    // 在路由配置中添加
                    <Route path="/algorithm">
                        <Route path="add" element={<AlgorithmConfigPage />} />
                        <Route path="list" element={<AlgorithmListPage />} />
                        <Route path="edit/:algorithmId" element={<AlgorithmEditPage />} />
                    </Route>

                    {/*// 在路由配置中添加*/}
                    {/*<Route path="/compute">*/}
                    {/*    <Route path="similarity" element={<SimilarityPage />} />*/}
                    {/*</Route>*/}
                    {/*<Route path="/algorithm.ts">*/}
                    {/*  <Route path="add" element={<AlgorithmConfigPage />} />*/}
                    {/*  <Route path="list" element={<AlgorithmListPage />} />*/}
                    {/*  <Route path="edit/:id" element={<AlgorithmConfigPage />} />*/}
                    {/*</Route>*/}
                    <Route path="/analysis">
                      <Route path="compare" element={<SimilarityPage />} />
                      <Route path="history" element={<SimilarityAnalysisHistory />} />
                      {/*<Route path="batch" element={<BatchAnalysisPage />} />*/}
                      {/*<Route path="history" element={<AnalysisHistoryPage />} />*/}
                    </Route>
                    <Route path="/algorithms">
                        <Route path="cosine" element={<CosineIntroduction />} />
                        <Route path="jaccard" element={<JaccardIntroduction />} />
                        <Route path="tfidf" element={<TFIDFIntroduction />} />
                        <Route path="levenshtein" element={<LevenshteinIntroduction />} />
                        <Route path="bert" element={<BertIntroduction />} />
                    </Route>
                    {/*<Route path="/algorithms/:algorithm.ts" element={<AlgorithmsPage />} />*/}
                    {/*<Route path="/tasks/list" element={<TaskListPage />} />*/}
                </Route>
            </Routes>
        </Router>
    );
}


export default App;
